package com.github.dockerjava;

import cn.abcsys.devops.client.api.command.DockerCmdExecFactory;
import cn.abcsys.devops.client.api.model.Info;
import cn.abcsys.devops.client.core.DefaultDockerClientConfig;
import cn.abcsys.devops.client.core.DockerClientImpl;
import cn.abcsys.devops.client.netty.NettyDockerCmdExecFactory;

public class DockerInfo {

	public final static String URL = "http://127.0.0.1:4243";
	
	public static void main(String[] args) {
		DockerCmdExecFactory dockerCmdExecFactory = new NettyDockerCmdExecFactory();
		DockerClientImpl client = DockerClientImpl.getInstance(config())
				.withDockerCmdExecFactory(dockerCmdExecFactory);
		Info info = client.infoCmd().exec();
		System.out.println(info.getDriver());
	}

	private static DefaultDockerClientConfig config() {
		DefaultDockerClientConfig.Builder builder = DefaultDockerClientConfig.createDefaultConfigBuilder()
                .withRegistryUrl(URL);

        return builder.build();
	}

}
